﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using OpenSoftStore.BusinessLogic.Member;
using OpenSoftStore.Client.Common;
using OpenSoftStore.Orm.Model;

namespace OpenSoftStore.Client.UIL.ManageMember.Info
{
    public partial class InValue : UserControl
    {
        private static InValue instance;
        public MemberValueRecordLogic MemberValueRecordBll;
        public T_Member Member;
        public static InValue Instance
        {
            get { return instance ?? (instance = new InValue()); }
        }

        public InValue()
        {
            InitializeComponent();
            Member=new T_Member();
            MemberValueRecordBll=new MemberValueRecordLogic();
            SPACommon.SetUiStyle(this);
        }

        public void GetMemberValueRecords(T_Member member)
        {
            Member = member;
            dgvMemberValueRecord.DataSource = MemberValueRecordBll.GetMemberValueRecords(" MemberId = '" + member.Id + "'");
        }

        private void tlSave_Click(object sender, EventArgs e)
        {
            var memberValueRecordEditWindow = new MemberValueRecordEditWindow();
            memberValueRecordEditWindow.GetMember(Member);
            memberValueRecordEditWindow.ShowDialog();
        }
    }
}
